from src.event.msg_event.private import Private_msg_event
from src.event.msg_event.Group import Group_msg_event


async def run(msg_data: dict, msg_type: str):
    """
    消息事件
    :param msg_data: 消息数据
    :param msg_type: 消息类型
    :return:
    """
    raw_message = msg_data["raw_message"]
    user_id = msg_data["user_id"]
    if msg_type == "private":
        await Private_msg_event.run(msg_data, raw_message, user_id)  # 私聊的消息
        return
    await Group_msg_event.run(msg_data, raw_message, msg_data["group_id"], user_id)  # 群聊消息
